package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.ActionFieldDaoImpl;
import com.asset.salesforce.domain.ActionField;

@Service
@Transactional(readOnly=true)
public class ActionFieldService {

	@Autowired
	private ActionFieldDaoImpl actionFieldDaoImpl;
	
	@Transactional(readOnly = false)
	public void addActionField(ActionField actionField){
		actionFieldDaoImpl.add(actionField);
	}
	@Transactional(readOnly = true)
	public ActionField getActionFieldById(ActionField actionField,Integer id){
		return actionFieldDaoImpl.getById(id,actionField);
	}
	@Transactional(readOnly = true)
	public List<ActionField> getActionFields(ActionField actionField){
		return actionFieldDaoImpl.getAll(actionField);
	}
	@Transactional(readOnly = true)
	public List<ActionField> getFieldsByTypeId(Integer typeId){
		return actionFieldDaoImpl.getAllFieldsByTypeId(typeId);
	}
}
